/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.cesupa.cabcc.mb;

import br.cesupa.cabcc.entity.Cargo;
import br.cesupa.cabcc.facade.CargoFacade;
import java.util.List;

/**
 *
 * @author yuri
 */

public class AdministrarCargosMB {

    private Cargo cargo;

    /** Creates a new instance of AdministrarCargosMB */
    public AdministrarCargosMB() {
    }

    public void novoCargo(){
        cargo = new Cargo();
    }

    public void cadastrarCargo(){
        cargo = CargoFacade.cadastrarCargo(cargo);
        if(cargo==null){
            novoCargo();
        }
    }

    public void excluirCargo(){
        CargoFacade.excluirCargo(cargo);
    }

    public void alterarCargo(){
        CargoFacade.atualizarCargo(cargo);
    }

    public List<Cargo> getListCargos() {
        return CargoFacade.getListCargos();
    }

    /**
     * @return the cargo
     */
    public Cargo getCargo() {
        return cargo;
    }

    /**
     * @param cargo the cargo to set
     */
    public void setCargo(Cargo cargo) {
        this.cargo = cargo;
    }
}
